<?php
/**
 * @author spenceryg
 * @date 2022/12/22
 * @time 9:20 上午
 * @focus love & life
 */


namespace app\common\controller;


use GuzzleHttp\Client;

class index extends \app\BaseController
{
    public function getAddress()
    {
        $address_point = input('address_point');
        $url =  'http://api.map.baidu.com/reverse_geocoding/v3/?ak=N76qSBxpITQLSoeeb8memjeHcTV2vxQx&output=json&coordtype=GCJ02&location=' . $address_point;
        dump($url);
        $client = new Client();
        $res = $client->get($url);
        $res = json_decode($res->getBody()->getContents(), true);
        dump($res);
    }
}
